using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace RichFrame
{
    /// <summary>
    /// 时间工具
    /// </summary>
    public static class TimeHelper
    {
        private static readonly long epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).Ticks;
        /// <summary>
        /// 获取当前时间：毫秒
        /// </summary>
        public static long NowMillisecond
        {
            get
            {
                return (DateTime.UtcNow.Ticks - epoch) / 10000;
            }
        }
        /// <summary>
        /// 获取当前时间：秒
        /// </summary>
        public static long NowSecond
        {
            get
            {
                return (DateTime.UtcNow.Ticks - epoch) / 10000000;
            }
        }
    }
}
